class Solution:
    def translateNum(self, num: int) -> int:
        if num < 10:
            return 1
        elif num < 26:
            return 2
        elif num < 100:
            return 1
        else:
            x = 1
            num, r = divmod(num, 100)
            y = 2 if 9 < r < 26 else 1
            old = r // 10
            while num:
                num, r = divmod(num, 10)
                if r == 1 or (r == 2 and old < 6):
                    z = y + x
                else:
                    z = y
                x, y = y, z
                old = r
        return z